import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    auth: ''
  },
  mutations: {
    setAuth(state, payload) {
      console.log(payload)
      state[payload.key] = payload.value
    }
  },
  actions: {
    getAuth({ commit }, payload) {
      console.log("payload", payload)
      commit('setAuth', { key: 'auth', value: payload })
    }
  },
  modules: {
  }
})
